//import com.itheima.Student;
//
//import java.io.BufferedWriter;
//import java.io.FileWriter;
//import java.io.IOException;
//import java.util.ArrayList;
//
//public class Collection2File_plus {
//    public static void main(String[] args) throws IOException {
//        ArrayList<Student> alt = new ArrayList<Student>();
//        alt.add(new Student("Zhang San","20"));
//        alt.add(new Student("Li Si","23"));
//        alt.add(new Student("Wang Wu","18"));
//        alt.add(new Student("Zhao Liu","22"));
//        alt.add(new Student("Qian Qi","29"));
//        String path = "MyFile\\src\\tmp\\StuInfo_plus.txt";
//
//        BufferedWriter bw = new BufferedWriter(new FileWriter(path));
//        for(Student stu : alt){
//            StringBuilder sb = new StringBuilder();
//            sb.append(stu.getName()).append(",").append(stu.getAge());
//            bw.write(sb.toString());
//            bw.newLine();
//            bw.flush();
//        }
//        bw.close();
//    }
//
//}
